home *** CD-ROM | disk | FTP | other *** search
/ SGI Performance Co-Pilot 1.3 / SGI Performance Co-Pilot 1.3.iso / dist / dist6.4 / pcp.idb / usr / pcp / lib / pmnsproc.sh.z / pmnsproc.sh
Linux/UNIX/POSIX Shell Script  |  1997-04-03  |  976b  |  56 lines

  1. #!/bin/sh
  2. #
  3. # common procedures for the PMNS scripts
  4. #
  5. # $Revision: 2.1 $
  6.  
  7. # find cpp
  8. #
  9. CPP=''
  10. for file in /lib/cpp /usr/lib/cpp \
  11.         /usr/cpu/sysgen/root/lib/cpp \
  12.         /usr/cpu/sysgen/root/usr/lib/cpp
  13. do
  14.     if [ -x $file ]
  15.     then
  16.     CPP=$file
  17.     break
  18.     fi
  19. done
  20. if [ -z "$CPP" ]
  21. then
  22.     echo "$prog: cannot locate \"cpp\", cannot proceed"
  23.     exit
  24. fi
  25.  
  26. # add -Uname controls to avoid translating any valid PCP name component
  27. # ... see cpp(1)
  28. #
  29. CPP="$CPP -Usgi -Uunix -Umips"
  30.  
  31. _can_load_ascii()
  32. {
  33.     if [ -x /usr/pcp/bin/pmbrand ]
  34.     then
  35.     /usr/pcp/bin/pmbrand -l 2>&1 | sed '/^Licenses /d' >/tmp/$$.tmp
  36.     if [ -s /tmp/$$.tmp ]
  37.     then
  38.         # at least one PCP license of some sort
  39.         if grep 'PCP ' /tmp/$$.tmp >/dev/null
  40.         then
  41.         # PCP Monitor or PCP Collector
  42.         :
  43.         else
  44.         # license does not permit PMNS rebuild, skip it
  45.         rm -f /tmp/$$.tmp
  46.         return 1
  47.         fi
  48.     else
  49.         # no PCP license => can load ASCII PMNS
  50.         :
  51.     fi
  52.     rm -f /tmp/$$.tmp
  53.     fi
  54.     return 0
  55. }
  56.